import request from '@/utils/request'
const baseUrl = process.env.NODE_ENV === 'production' ? '' : '/vehicleMap'

export function listCar(query) {
  return request({
    url:baseUrl+ '/device/list',
    method: 'get',
    params: query
  })
}

export function exportcar(query) {
  return request({
    url:baseUrl+ '/device/export',
    method: 'get',
    params: query
  })
}

export function fetchPv(pv) {
  return request({
    url:baseUrl+ '/vue-element-admin/article/pv',
    method: 'get',
    params: { pv }
  })
}

export function addCar(data) {
  return request({
    url:baseUrl+ '/car',
    method: 'post',
    data
  })
}

export function updateCar(data) {
  return request({
    url:baseUrl+ '/car',
    method: 'put',
    data
  })
}

export function deleteCar(data) {
    return request({
      url:baseUrl+ '/car/delete',
      method: 'delete',
      data
    })
  }
